package com.haiheng.module_main.mode

import com.haiheng.common.api.API
import com.haiheng.common.bean.*
import com.haiheng.common.constant.AppConstant
import com.haiheng.library_base.toast.AppUtils
import com.haiheng.library_base.toast.Utils
import com.haiheng.library_base.utils.SystemUtil

/**
 *
 * @Des:
 * @Author: hwz
 * @Date:2022/5/6 0006
 * @Version: 1.0
 */
 object RequestDataHelper {
    fun getAddMachineData() :BaseReqVo<AddMachineReq> {
        var req =BaseReqVo<AddMachineReq>()
        var machineReq = AddMachineReq()
        machineReq.LibraryCode = AppConstant.getLibraryCode()
        machineReq.MachineUuid = AppConstant.getMachineUuid()
        machineReq.Name = AppConstant.getMachineName()
        machineReq.Address = ""
        machineReq.MachineCatalogType = API.PARAM.PARAGE_CATALOG_TYPE
        machineReq.MachineModelType = API.PARAM.PARAGN_MODE_TYPE
        req.data = machineReq
        req.appInfo = ReqAppInfoVo()
        req.operation = API.OPERATION.ADDMACHINE
        req.requestObject = API.PARAM.PARAGM_REQUEST_OBJECT
        req.description = "添加广告屏设备"
        return req
    }


    fun getAddStatusData():BaseReqVo<AddStatusReq>{

        //LibraryCode MachineUuid MachineCatalogType MachineModelType必传
        //Name
        var req =BaseReqVo<AddStatusReq>()
        var addStatusReq = AddStatusReq()
        addStatusReq.MachineUuid = AppConstant.getMachineUuid()
//        addStatusReq.Name = AppConstant.getMachineName()
//        addStatusReq.MachineCatalogType = API.PARAM.PARAGE_CATALOG_TYPE
//        addStatusReq.MachineModelType = API.PARAM.PARAGN_MODE_TYPE
//        addStatusReq.LibraryCode = AppConstant.getLibraryCode()

        addStatusReq.ComponentType = 0
        addStatusReq.Ok = true.toString()
        var content = AddStatusContent()
        content.AppRunStatus = 0 // //应用运行状态 0（正常）、1（闲置没人操作）、2（有人操作中）、3（故障）
        content.MqttDevClientStatus = false
        content.OuterNetStatus = true
        content.InnerNetStatus = true
        content.NanoClientStatus = true

        var extDevicesRunStatus  = ExtDevicesRunStatus()
        var runStatus = DevicesRunStatusData()
        runStatus.DisplayName = "智慧屏"
        runStatus.IsInitial = true
        runStatus.IsOnline = true
        runStatus.IsOpend = true
        runStatus.IsWorking = true

        extDevicesRunStatus.AdScreen = runStatus
        content.ExtDevicesRunStatus = extDevicesRunStatus
        addStatusReq.Content = content

        req.data = addStatusReq
        req.appInfo = ReqAppInfoVo()
        req.operation = API.OPERATION.ADDSTATUS
        req.requestObject = API.PARAM.PARAGM_REQUEST_OBJECT
        req.description = "上报设备状态"
        return req
    }

}